preview=function(_data)
{
	this.data=_data;
	this.is_show=false;
	this.in_filter=true;
}
preview.prototype.compile=function()
{
	//console.log(this.data.city.join(', '));
	this.content=$('<div id="'+this.data.id+'"> <div  class="dimg">' +
					'<img src="'+this.data.fotos[0]+'"width=100px alt="foto" />' +
					'</div>' +
					'<div class="text_prosm">' +
					'<span class=text_prosm_name>'+this.data.name+'</span>' +
					'<br />' +
					'<span>ночей:</span><span class="znachenie">'+this.data.nights+'</span><br><span>город: </span><span class="znachenie">'+this.data.city.join(', ')+'</span>' +
					'</div>' +
					'<div class="price_txt">' +
					'<span>ЦЕНА от '+this.data.min_p+' до '+this.data.max_p+'</span>' +
					'</div>');
}
preview.prototype.show=function(where)
{
	this.is_show=true;
	if(this.content==null)
	{
		this.compile();
	}
	if((where=='')||(where==null))
	{
		//console.log('show');
		return $(this.content);
	}
	else
	{
		$(where).append(this.content);
	}
}
preview.prototype.hide=function()
{
	this.is_show=false;
	$('#'+this.data.id).hide();
}